export interface RunnerSpec {
  component: string;
  phase?: string;
  figma?: {
    mainUrl?: string;
    fallback?: string;
    fileKey?: string;
    nodeId?: string;
    rawPath?: string;
    minPath?: string;
    tokensPath?: string;
    summaryPath?: string;
  };
  blueprint?: {
    path: string;
  };
  schema?: {
    fields?: string;
    edit?: string;
    preview?: string;
    belongToDir?: string;
  };
  output?: {
    dir: string;
    raw?: string;
    min?: string;
    tokens?: string;
    summary?: string;
    logs?: string;
  };
  options?: Record<string, unknown>;
  metrics?: {
    tokenBefore?: number;
    tokenAfter?: number;
  };
  report?: {
    path?: string;
  };
  [key: string]: unknown;
}

export interface TaskResult {
  summary: string;
  outputPaths?: Record<string, string>;
  data?: Record<string, unknown>;
  metrics?: {
    tokenBefore?: number;
    tokenAfter?: number;
  };
}

export interface TaskContext {
  rootDir: string;
  workspaceDir: string;
}

export type TaskHandler = (spec: RunnerSpec, context: TaskContext) => Promise<TaskResult>;
